package com.vma.interfaceShoes.controller;

import com.jfinal.core.Controller;
import com.jfinal.kit.HttpKit;
import com.vma.interfaceShoes.util.ReturnsUtil;
import com.vma.suggestion.service.ArticleService;
import net.sf.json.JSONObject;

/**
 * Created by chenzui on 2017/5/6.
 */
public class ArticleController extends Controller {
    public void qryArticleList(){
        try {
            renderJson(ReturnsUtil.returnSuccess(ArticleService.qryArticleList()));
        }catch (Exception e){
            e.printStackTrace();
            renderJson(ReturnsUtil.returnException(e.getMessage(),e));
        }
    }

    public void getArticleById(){
        try {
            Integer articleId = getParaToInt("articleId");
            renderJson(ReturnsUtil.returnSuccess(ArticleService.getArticleById(articleId)));
        }catch (Exception e){
            e.printStackTrace();
            renderJson(ReturnsUtil.returnException(e.getMessage(),e));
        }
    }
}
